/*
This file is part of TGames.Bonapart(c)2010 , for future releases contact by xmpp://bonapart@qip.ru


    TGames is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    TGames is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with TGames.  If not, see <http://www.gnu.org/licenses/>.
  */
#include <QtGui>
#include "numbersaround.h"
#include "configer.h"

configer::configer(QWidget *parent)
    : QDialog(parent){
this->setWindowTitle("TGames - Numbers around");
QPushButton *startb=new QPushButton("Start game",this);









QLabel *com1=new QLabel("Difficult level\\simple",this);
df=new QSlider (Qt::Horizontal,this);
df->setMaximum(10);
df->setValue(10);
df->setMinimum(3);
QLabel *com2=new QLabel("Difficult level\\logariphmic",this);
df2=new QSlider(Qt::Horizontal,this);
df2->setMinimum(1);
df2->setMaximum(3);
df2->setValue(1);

QLabel *com3=new QLabel("Game speed",this);
spd=new QSlider (Qt::Horizontal,this);
spd->setMaximum(10);
spd->setValue(5);
spd->setMinimum(1);

QLabel *com4=new QLabel("Free fields",this);
free=new QSlider (Qt::Horizontal,this);
free->setMaximum(75);
free->setValue(25);
free->setMinimum(0);

QLabel *com5=new QLabel("Rules set",this);
centr=new QCheckBox("with centr",this);
hardcore=new QCheckBox("hardcore",this);
modern=new QRadioButton("Modern rules",this);
classic=new QRadioButton("Clasic rules",this);

QVBoxLayout *lay=new QVBoxLayout(this);
lay->addWidget(com1);
lay->addWidget(df);
lay->addWidget(com2);
lay->addWidget(df2);
lay->addWidget(com3);
lay->addWidget(spd);
lay->addWidget(com4);
lay->addWidget(free);


lay->addWidget(com5);
lay->addWidget(hardcore);
lay->addWidget(modern);
lay->addWidget(classic);
lay->addWidget(centr);

lay->addWidget(startb);
lay->setAlignment(Qt::AlignCenter);
connect (startb,SIGNAL(clicked()),this,SLOT(gamestart()));
}

configer::~configer(){

}


void configer::gamestart(){
    NumbersAround w;
    w.sh=64;
    w.sw=64;
    w.difficult=df2->value();
    w.diff2=df->value();
    w.ccont=centr->isChecked();
    w.rules=classic->isChecked();
    w.speed=spd->value();
    w.free=free->value();
    w.hardcore=hardcore->isChecked();
    w.init();
    w.exec();
}

